package com.aikon.wht.designPattern.async;

import java.util.concurrent.Callable;

/**
 * @author haitao.wang
 */
public class TestOfCall {

    public static void main(String[] args) throws Exception {
        Object obj = new Object();

        new Thread(()-> {

        }).start();

        Callable callable = () -> {
            System.out.println("asdf");
            Thread.sleep(5000);
            System.out.println("TT");
            synchronized (obj){
                obj.wait(6000);
            }
            return "task end";
        };
        String s= null;
        try {
            s = (String) callable.call();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(s);

        System.out.println("GG");




    }
}
